package com.xiweicheng.test.jpa;
// Generated 2018-7-14 9:20:43 by Hibernate Tools 5.0.6.Final

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

/**
 * Space generated by hbm2java
 */
@Entity
@Table(name = "space", catalog = "tms")
public class Space implements java.io.Serializable {

	private Long id;
	private long version;
	private Users usersByUpdater;
	private Users usersByCreator;
	private Date createDate;
	private String description;
	private String name;
	private Boolean opened;
	private Boolean privated;
	private String status;
	private String type;
	private Date updateDate;
	private Set<Blog> blogs = new HashSet<Blog>(0);
	private Set<SpaceAuthority> spaceAuthorities = new HashSet<SpaceAuthority>(0);

	public Space() {
	}

	public Space(String status) {
		this.status = status;
	}

	public Space(Users usersByUpdater, Users usersByCreator, Date createDate, String description, String name,
			Boolean opened, Boolean privated, String status, String type, Date updateDate, Set<Blog> blogs,
			Set<SpaceAuthority> spaceAuthorities) {
		this.usersByUpdater = usersByUpdater;
		this.usersByCreator = usersByCreator;
		this.createDate = createDate;
		this.description = description;
		this.name = name;
		this.opened = opened;
		this.privated = privated;
		this.status = status;
		this.type = type;
		this.updateDate = updateDate;
		this.blogs = blogs;
		this.spaceAuthorities = spaceAuthorities;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Version
	@Column(name = "version", nullable = false)
	public long getVersion() {
		return this.version;
	}

	public void setVersion(long version) {
		this.version = version;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "updater")
	public Users getUsersByUpdater() {
		return this.usersByUpdater;
	}

	public void setUsersByUpdater(Users usersByUpdater) {
		this.usersByUpdater = usersByUpdater;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "creator")
	public Users getUsersByCreator() {
		return this.usersByCreator;
	}

	public void setUsersByCreator(Users usersByCreator) {
		this.usersByCreator = usersByCreator;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_date", length = 19)
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Column(name = "description")
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "name")
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "opened")
	public Boolean getOpened() {
		return this.opened;
	}

	public void setOpened(Boolean opened) {
		this.opened = opened;
	}

	@Column(name = "privated")
	public Boolean getPrivated() {
		return this.privated;
	}

	public void setPrivated(Boolean privated) {
		this.privated = privated;
	}

	@Column(name = "status", nullable = false)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Column(name = "type")
	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "update_date", length = 19)
	public Date getUpdateDate() {
		return this.updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "space")
	public Set<Blog> getBlogs() {
		return this.blogs;
	}

	public void setBlogs(Set<Blog> blogs) {
		this.blogs = blogs;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "space")
	public Set<SpaceAuthority> getSpaceAuthorities() {
		return this.spaceAuthorities;
	}

	public void setSpaceAuthorities(Set<SpaceAuthority> spaceAuthorities) {
		this.spaceAuthorities = spaceAuthorities;
	}

}
